Operations

Duplication
  • duplicate operator to act on current line.

    • dd

      • delete line

    • yy

      • yank line

    • >>

      • indent line

    • ==

      • format line

Insertion
  • a

    • (append)

    • text after the cursor

  • A

    • (insert)

    • text at the end of the line

  • i

    • (insert)

    • text before the cursor

  • I

    • (insert)

    • text at the beginning of the line

  • c

    • (change)

    • ce

      • deletes until the end of the word and goes to insert mode.

    • c$

      • deletes until the end of the line and goes to insert mode.

  • o

    • (open)

    • text in the line below

  • O

    • (open)

    • text in the line above

  • r

    • (replace)

    • rx

      • replace the char with x

    • rr

      • replace the char with r

  • $ R

    • (replace)

    • replaces all the following chars

    • R1235566

      • replaces all the following chars with 1235566

Visual Selection
  • v

    • (visual selection mode)

    • selects text

    • if : is pressed, it's going to type :'<,'>  automatically. You can type commands after this line of code, to only affect the selection

  • V

    • visual selection lines mode

    • select lines

  • ctrl v

    • visual selection block mode

Substitute
  • :s/thee/the

    • substitute thee for the, only the first apperance

    • :s/thee/the/g

      • substitute thee for the whole line

    • :%s/thee/the/g

      • substitute thee for the whole file

    • :%s/thee/the/gc

      • substitute thee for the whole file, with a prompt asking if should substitute

Delete
  • x

    • delete char

  • X

    • delete previous char

  • d

    • dw

      • delete word

      • d3w

        • deletes 3 words

    • de

      • delete until the end of the current word

    • d$

      • delete until the end of the line

    • dd

      • delete line

      • 2dd

        • deletes 2 lines

Yank (Copy)
  • y

    • copy text

    • leaves the visual mode, if it's in it

  • Y

    • copy the text from the cursor to the end of the line

Put (Paste)
  • p

    • puts the previously deleted text after  the cursor.

  • P

    • puts the previously deleted text before  the cursor.

Undo
  • u

    • undo

  • $ U

    • undo the whole line to its original state

  • $ ctrl r

    • redo

Casing
  • $

    • swap case

  • g

    • swap case in the whole line

  • gu

    • make lowercase

  • gU

    • make uppercase

Formatting
  • ==

    • text formatting

Folding
  • zf

    • zf5j

      • creates a folding region for the 5 lines below